import request from "@/api/index"

export default{
  /**
   * @description: 添加 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
   add(params,noType){
    const url = "/no/configCode/add"
    return request.post(url,{
      "noRule": `${params}`,
      "noType": noType,
      homeBaseId:sessionStorage.getItem("homeBaseId"),
      homeBaseType:sessionStorage.getItem("homeBaseType"),
    })
  },
  /**
   * @description: 编辑 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
   edit(params){
    const url = "/no/configCode/edit"
    return request.post(url,{
      ...params
    })
  },
  /**
   * @description: 单个删除 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
   delById(params){
    const url = "/no/configCode/del"
    return request.get(url,params)
  },
  /**
   * @description: 创建编号 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  generateNo(params){
    const url = "no/configCode/generateNo"
    return request.get(url,params)
  },
  /**
   * @description: 批量删除 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  delListById(params){
    const url = "/no/configCode/delList"
    return request.get(url,params)
  },
  /**
   * @description: 条件查询 *代表必填
   * @param {Object} {type:[FEED,DRUGS,MATERIAL]}*
   * @return {Object}
   */
   queryByCondition(params){
    const url = "/no/configCode/queryByCondition"
    return request.post(url,{
      ...params
    })
   },
  /**
   * @description: 分页查询 *代表必填
   * @param {Object} params *
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @return {Object}
   */
   queryPageByCondition(params){
    const url = "/no/configCode/queryPageList"
    return request.post(url,{
      ...params
    })
   }
}
